using DataAccess.Entities;
using FluentNHibernate.Mapping;

namespace DataAccess.Mappings
{
    public sealed class AccountMap : ClassMap<Account>
    {
        public AccountMap()
        {
            Id(x => x.Id);
            Map(x => x.FirstName);
            Map(x => x.LastName);
            Map(x => x.UserName);
            Map(x => x.Email);
            Map(x => x.Password);
            References(x => x.Passion);
            References(x => x.Profile);
            Map(x => x.MembershipId);
            HasManyToMany(x => x.MediaTaggedIn).Cascade.All().Inverse().Table("Tags");
        }
    }
}